package approachingjvm.classloader;

/**
 * 废柴的类加载器
 */
public class UselessClassLoader extends ClassLoader {
    /**
     * 传入parent
     *
     * @param parent
     */
    public UselessClassLoader(ClassLoader parent) {
        super(parent);
    }

    @Override
    public Class<?> findClass(String s) throws ClassNotFoundException {
        System.out.println("findClass");
        // find and define a class
        // defineClass(str, bytes, i1, i2);
        return super.findClass(s);
    }

    @Override
    protected Class<?> loadClass(String s, boolean b) throws ClassNotFoundException {
        System.out.println("loadClass");
        return super.loadClass(s, b);
    }

    @Override
    public Class<?> loadClass(String s) throws ClassNotFoundException {
        System.out.println("loadClass");
        return super.loadClass(s);
    }
}
